# $LastChangedDate: 2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011) $
# Author:	Jim E. Brooks  http://www.palomino3d.org
# Desc:		
# Notes:	base library must be compiled first.
# =============================================================================

DEBUG       := 1
ROOT_DIR 	:= ../..
SRC_DIR     := src
OUT_DIR		:= out
include $(ROOT_DIR)/tests/tools/GNUmakefile_defs
LDFLAGS 	+= $(LIB_BASE) $(LIB_GLUE) $(LIB_GFX) $(LIB_MATH)
TARGET_NAME	:= "graphics tests"
CXXFLAGS    += -I../base/src  # base tests to include test.hh
EXECS		:= $(OUT_DIR)/test_basic_types

# Some tests have code that ironically should cause compile-errors.
ifeq ($(TEST_COMPILE_ERRORS),1)
CXXFLAGS	+= -DTEST_COMPILE_ERRORS=1
endif

ifeq ($(QUIET),1)
define COMPILE_TEST
	@echo Compiling graphics test $(notdir $<)
	@$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS) $(SYS_LIBS)
endef
else
define COMPILE_TEST
	$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS) $(SYS_LIBS)
endef
endif

all:  splash  $(OUT_DIR)/made  $(EXECS) 

$(OUT_DIR)/test_basic_types: $(SRC_DIR)/test_basic_types.cc  $(TEST_DEPS)
	$(COMPILE_TEST)

define EXTRA_CLEANING
	@rm -rf $(OUT_DIR)
	@rm -f core.* *.core *.o *ERROR_LOG* temp* a.out
endef

include $(TOOLS_DIR)/GNUmakefile_rules
